SRCS := $(wildcard *.c)
OBJS := $(patsubst %.c,%.o,$(SRCS))
DEPS := $(patsubst %.c,%.d,$(SRCS))
TARGET := client
CC := gcc 
COM_OP := -Wall -g -pthread -lmysqlclient -lcrypt
CPPFLAGS := -MMD -MP

.PHONY: clean rebuild all 

all: $(TARGET)

$(TARGET): $(OBJS)
	$(CC) $^ -o $@ $(COM_OP)

%.o: %.c
	$(CC) -c $< -o $@ $(COM_OP) $(CPPFLAGS)

clean :
	$(RM) $(OBJS) $(TARGET) $(DEPS)

rebuild: clean all

-include $(DEPS)
